

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=&#34;auto&#34;>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/favicon.png">
  <link rel="icon" href="/img/favicon.png">
  <meta name="viewport"
        content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="description" content="">
  <meta name="author" content="John Doe">
  <meta name="keywords" content="">
  
  <title>violet apricity</title>

  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" />



<!-- 主题依赖的图标库，不要自行修改 -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_ba1fz6golrf.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_kmeydafke9r.css">


<link  rel="stylesheet" href="/css/main.css" />

<!-- 自定义样式保持在最底部 -->


  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    var CONFIG = {"hostname":"example.com","root":"/","version":"1.8.9","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"right","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"copy_btn":true,"image_zoom":{"enable":true},"toc":{"enable":true,"headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":false,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null}}};
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
<meta name="generator" content="Hexo 5.4.0"></head>


<body>
  <header style="height: 100vh;">
    <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand"
       href="/">&nbsp;<strong>violet apricity</strong>&nbsp;</a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" data-toggle="modal" data-target="#modalSearch">&nbsp;<i
                class="iconfont icon-search"></i>&nbsp;</a>
          </li>
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" href="javascript:">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

    <div class="banner" id="banner" parallax=true
         style="background: url('/image/violet.png') no-repeat center center;
           background-size: cover;">
      <div class="full-bg-img">
        <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
          <div class="page-header text-center fade-in-up">
            <span class="h2" id="subtitle" title="violet-apricity">
              
            </span>

            
          </div>

          
            <div class="scroll-down-bar">
              <i class="iconfont icon-arrowdown"></i>
            </div>
          
        </div>
      </div>
    </div>
  </header>

  <main>
    
      <div class="container nopadding-x-md">
        <div class="py-5" id="board"
          style=margin-top:0>
          
          <div class="container">
            <div class="row">
              <div class="col-12 col-md-10 m-auto">
                


  <div class="row mx-auto index-card">
    
    
      <div class="col-12 col-md-4 m-auto index-img">
        <a href="/2021/05/18/GZHU2021week11/" target="_self">
          <img src="/image/egg.png" srcset="/img/loading.gif" lazyload alt="广州大学ACM2021第11周训练">
        </a>
      </div>
    
    <article class="col-12 col-md-8 mx-auto index-info">
      <h1 class="index-header">
        
        <a href="/2021/05/18/GZHU2021week11/">广州大学ACM2021第11周训练</a>
      </h1>

      <p class="index-excerpt">
        <a href="/2021/05/18/GZHU2021week11/">
          
          
            
          
          广州大学ACM2021第11周训练闲话：很久没打周赛了（其实是没有），五个小时上线了三个小时，整体来说前面五题都很简单，不过在细节处一直没处理好，很考验心态。最后是a4题，第五题读完题就有事跑路了，不过也是道暴力枚举题，稍微二进制压缩一下而已。
A - 交易 Gym - 102890I题意大致意思是要去买三本书（一开始读成n本书），给出了价格，可以根据需要组合起来去付款，这里有个优惠，就是满500
        </a>
      </p>

      <div class="index-btm post-metas">
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-date"></i>
            <time datetime="2021-05-18 18:24" pubdate>
              2021-05-18
            </time>
          </div>
        
        
        
          <div class="post-meta">
            <i class="iconfont icon-tags"></i>
            
              <a href="/tags/ACM/">ACM</a>
            
              <a href="/tags/%E5%B9%BF%E5%B7%9E%E5%A4%A7%E5%AD%A6/">广州大学</a>
            
          </div>
        
      </div>
    </article>
  </div>

  <div class="row mx-auto index-card">
    
    
      <div class="col-12 col-md-4 m-auto index-img">
        <a href="/2021/05/18/ECR109Div2/" target="_self">
          <img src="/image/egg.png" srcset="/img/loading.gif" lazyload alt="Educational Codeforces Round 109 Div. 2 2021.05.16">
        </a>
      </div>
    
    <article class="col-12 col-md-8 mx-auto index-info">
      <h1 class="index-header">
        
        <a href="/2021/05/18/ECR109Div2/">Educational Codeforces Round 109 Div. 2 2021.05.16</a>
      </h1>

      <p class="index-excerpt">
        <a href="/2021/05/18/ECR109Div2/">
          
          
            
          
          Educational Codeforces Round 109 Div. 2 2021.05.16A. Potion-making题意两个数a，b占比分别为k%和(100-k)%，输入k求a+b最小值。
题解不妨先取一个一定满足题意的，即a=k，b=100-k，然后再考虑缩小。分别除以gcd就好了。
code123456789101112131415161718192021222324using
        </a>
      </p>

      <div class="index-btm post-metas">
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-date"></i>
            <time datetime="2021-05-18 18:21" pubdate>
              2021-05-18
            </time>
          </div>
        
        
        
          <div class="post-meta">
            <i class="iconfont icon-tags"></i>
            
              <a href="/tags/ACM/">ACM</a>
            
              <a href="/tags/codeforces/">codeforces</a>
            
          </div>
        
      </div>
    </article>
  </div>

  <div class="row mx-auto index-card">
    
    
      <div class="col-12 col-md-4 m-auto index-img">
        <a href="/2021/05/18/CF1516B/" target="_self">
          <img src="/image/egg.png" srcset="/img/loading.gif" lazyload alt="CF1516B.二进制">
        </a>
      </div>
    
    <article class="col-12 col-md-8 mx-auto index-info">
      <h1 class="index-header">
        
        <a href="/2021/05/18/CF1516B/">CF1516B.二进制</a>
      </h1>

      <p class="index-excerpt">
        <a href="/2021/05/18/CF1516B/">
          
          
            
          
          位运算（异或）CFR717DIv.21516B. AGAGA XOOORRR这里考查异或的性质：
x^y==z&lt;—–&gt;y==x^zx^x=0题意：t组，每组n和n个数，现在可以选任意两个相邻的数取异或，其结果取代原本两个数。问是否可以通过若干次操作使之只剩下两个以上个相同的数。
题解：首先考虑剩下几个数。
剩下两个：上述提到的，x^x=0，所以若所有数^起来的结果为0，那么说明可以分成
        </a>
      </p>

      <div class="index-btm post-metas">
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-date"></i>
            <time datetime="2021-05-18 18:11" pubdate>
              2021-05-18
            </time>
          </div>
        
        
        
          <div class="post-meta">
            <i class="iconfont icon-tags"></i>
            
              <a href="/tags/ACM/">ACM</a>
            
              <a href="/tags/%E4%BA%8C%E8%BF%9B%E5%88%B6/">二进制</a>
            
              <a href="/tags/%E4%BD%8D%E8%BF%90%E7%AE%97/">位运算</a>
            
          </div>
        
      </div>
    </article>
  </div>

  <div class="row mx-auto index-card">
    
    
      <div class="col-12 col-md-4 m-auto index-img">
        <a href="/2021/04/20/Codeforces-Round-716-Div-2-2021-04-19/" target="_self">
          <img src="/image/egg.png" srcset="/img/loading.gif" lazyload alt="CFR716(Div.2)2021.04.19">
        </a>
      </div>
    
    <article class="col-12 col-md-8 mx-auto index-info">
      <h1 class="index-header">
        
        <a href="/2021/04/20/Codeforces-Round-716-Div-2-2021-04-19/">CFR716(Div.2)2021.04.19</a>
      </h1>

      <p class="index-excerpt">
        <a href="/2021/04/20/Codeforces-Round-716-Div-2-2021-04-19/">
          
          
            
          
          Codeforces Round #716 (Div. 2)闲话：这场是九点半开始的，九点上完课匆匆忙忙跑回宿舍收拾一下刚好赶上。记得上一次定了个小目标（过三题！），这一次还真让我达成了。虽说不是什么很有代表性的题，但好歹也是我第一次cf切三读四（虽然切完三题有剩时间但读一下D就走了并不打算写）。所以呢还是有一点小开心，总算是有点进步。不过还是不能骄傲自满，我和同阶段选手的差距还大着呢。所以得继续
        </a>
      </p>

      <div class="index-btm post-metas">
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-date"></i>
            <time datetime="2021-04-20 12:22" pubdate>
              2021-04-20
            </time>
          </div>
        
        
        
          <div class="post-meta">
            <i class="iconfont icon-tags"></i>
            
              <a href="/tags/ACM/">ACM</a>
            
              <a href="/tags/codeforces/">codeforces</a>
            
          </div>
        
      </div>
    </article>
  </div>

  <div class="row mx-auto index-card">
    
    
      <div class="col-12 col-md-4 m-auto index-img">
        <a href="/2021/04/19/lzw666/" target="_self">
          <img src="/image/egg.png" srcset="/img/loading.gif" lazyload alt="lzw666">
        </a>
      </div>
    
    <article class="col-12 col-md-8 mx-auto index-info">
      <h1 class="index-header">
        
        <a href="/2021/04/19/lzw666/">lzw666</a>
      </h1>

      <p class="index-excerpt">
        <a href="/2021/04/19/lzw666/">
          
          
            
          
          
        </a>
      </p>

      <div class="index-btm post-metas">
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-date"></i>
            <time datetime="2021-04-19 20:33" pubdate>
              2021-04-19
            </time>
          </div>
        
        
        
      </div>
    </article>
  </div>

  <div class="row mx-auto index-card">
    
    
      <div class="col-12 col-md-4 m-auto index-img">
        <a href="/2021/04/18/stack/" target="_self">
          <img src="/image/egg.png" srcset="/img/loading.gif" lazyload alt="stack(栈)">
        </a>
      </div>
    
    <article class="col-12 col-md-8 mx-auto index-info">
      <h1 class="index-header">
        
        <a href="/2021/04/18/stack/">stack(栈)</a>
      </h1>

      <p class="index-excerpt">
        <a href="/2021/04/18/stack/">
          
          
            
          
          栈规则：LIFO后入先出：Last in first out——LIFO
实现&amp;操作：数组模拟：12345678910111213141516const int N=10000;//lengthint s[N];//for int,from s[1] to s[top]int top;//the last in-numbool isEmpty()&#123;return top==0;&#
        </a>
      </p>

      <div class="index-btm post-metas">
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-date"></i>
            <time datetime="2021-04-18 15:48" pubdate>
              2021-04-18
            </time>
          </div>
        
        
        
          <div class="post-meta">
            <i class="iconfont icon-tags"></i>
            
              <a href="/tags/ACM/">ACM</a>
            
              <a href="/tags/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/">数据结构</a>
            
              <a href="/tags/stack/">stack</a>
            
          </div>
        
      </div>
    </article>
  </div>

  <div class="row mx-auto index-card">
    
    
      <div class="col-12 col-md-4 m-auto index-img">
        <a href="/2021/04/18/vector/" target="_self">
          <img src="/image/egg.png" srcset="/img/loading.gif" lazyload alt="vector(向量)">
        </a>
      </div>
    
    <article class="col-12 col-md-8 mx-auto index-info">
      <h1 class="index-header">
        
        <a href="/2021/04/18/vector/">vector(向量)</a>
      </h1>

      <p class="index-excerpt">
        <a href="/2021/04/18/vector/">
          
          
            
          
          向量相当于一个动态数组/可变长数组
123456789101112#include&lt;vector&gt;std::vector&lt;Typename T&gt;v;//std::vector&lt;int&gt;v;int len=v.size();int x;v.push_back(x);v.pop_back();for(int i=v.begin();i&lt;=v.end();i++
        </a>
      </p>

      <div class="index-btm post-metas">
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-date"></i>
            <time datetime="2021-04-18 15:48" pubdate>
              2021-04-18
            </time>
          </div>
        
        
        
          <div class="post-meta">
            <i class="iconfont icon-tags"></i>
            
              <a href="/tags/ACM/">ACM</a>
            
              <a href="/tags/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/">数据结构</a>
            
              <a href="/tags/vector/">vector</a>
            
          </div>
        
      </div>
    </article>
  </div>

  <div class="row mx-auto index-card">
    
    
      <div class="col-12 col-md-4 m-auto index-img">
        <a href="/2021/04/18/queue/" target="_self">
          <img src="/image/egg.png" srcset="/img/loading.gif" lazyload alt="queue(队列)">
        </a>
      </div>
    
    <article class="col-12 col-md-8 mx-auto index-info">
      <h1 class="index-header">
        
        <a href="/2021/04/18/queue/">queue(队列)</a>
      </h1>

      <p class="index-excerpt">
        <a href="/2021/04/18/queue/">
          
          
            
          
          队列规则：FIFO先入先出：First in first out——FIFO
队列模拟：数组模拟队列：12345678910111213141516//由于进出是整体队列往数组右移，因此可以将数组视为环形缓冲区const int N=1000;int s[N];int head,tail;//头和尾指针（实际是下标）void isempty()&#123;return head==tail;&#1
        </a>
      </p>

      <div class="index-btm post-metas">
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-date"></i>
            <time datetime="2021-04-18 15:47" pubdate>
              2021-04-18
            </time>
          </div>
        
        
        
          <div class="post-meta">
            <i class="iconfont icon-tags"></i>
            
              <a href="/tags/ACM/">ACM</a>
            
              <a href="/tags/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/">数据结构</a>
            
              <a href="/tags/queue/">queue</a>
            
          </div>
        
      </div>
    </article>
  </div>

  <div class="row mx-auto index-card">
    
    
      <div class="col-12 col-md-4 m-auto index-img">
        <a href="/2021/04/18/binary-search/" target="_self">
          <img src="/image/egg.png" srcset="/img/loading.gif" lazyload alt="二分&amp;三分">
        </a>
      </div>
    
    <article class="col-12 col-md-8 mx-auto index-info">
      <h1 class="index-header">
        
        <a href="/2021/04/18/binary-search/">二分&amp;三分</a>
      </h1>

      <p class="index-excerpt">
        <a href="/2021/04/18/binary-search/">
          
          
            
          
          二分&amp;三分二分简介：二分查找（英语：binary search），也称折半搜索（英语：half-interval search）、对数搜索（英语：logarithmic search），是用来在一个有序序列中查找某一元素的算法。
二分是一种细节很多实现很容易出错的搜索算法。
原理：以在一个升序数组中查找一个数为例。
它每次考察数组当前部分的中间元素，如果中间元素刚好是要找的，就结束搜索过程
        </a>
      </p>

      <div class="index-btm post-metas">
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-date"></i>
            <time datetime="2021-04-18 15:45" pubdate>
              2021-04-18
            </time>
          </div>
        
        
        
          <div class="post-meta">
            <i class="iconfont icon-tags"></i>
            
              <a href="/tags/ACM/">ACM</a>
            
              <a href="/tags/%E7%AE%97%E6%B3%95Algorithm/">算法Algorithm</a>
            
              <a href="/tags/%E4%BA%8C%E5%88%86/">二分</a>
            
              <a href="/tags/%E4%B8%89%E5%88%86/">三分</a>
            
          </div>
        
      </div>
    </article>
  </div>

  <div class="row mx-auto index-card">
    
    
      <div class="col-12 col-md-4 m-auto index-img">
        <a href="/2021/04/18/greedy-algorithm/" target="_self">
          <img src="/image/egg.png" srcset="/img/loading.gif" lazyload alt="贪心">
        </a>
      </div>
    
    <article class="col-12 col-md-8 mx-auto index-info">
      <h1 class="index-header">
        
        <a href="/2021/04/18/greedy-algorithm/">贪心</a>
      </h1>

      <p class="index-excerpt">
        <a href="/2021/04/18/greedy-algorithm/">
          
          
            
          
          贪心贪心算法（英语：greedy algorithm）又称贪婪算法，是用计算机来模拟一个“贪心”的人做出决策的过程。这个人十分贪婪，每一步行动总是按某种指标选取最优的操作。而且他目光短浅，总是只看眼前，并不考虑以后可能造成的影响。
可想而知，并不是所有的时候贪心法都能获得最优解，所以一般使用贪心法的时候，都要确保自己能证明其正确性。
但是事实上在大多比赛的时候不会去很严谨的证明，所以这是个很玄学的
        </a>
      </p>

      <div class="index-btm post-metas">
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-date"></i>
            <time datetime="2021-04-18 15:43" pubdate>
              2021-04-18
            </time>
          </div>
        
        
        
          <div class="post-meta">
            <i class="iconfont icon-tags"></i>
            
              <a href="/tags/ACM/">ACM</a>
            
              <a href="/tags/%E7%AE%97%E6%B3%95Algorithm/">算法Algorithm</a>
            
              <a href="/tags/%E8%B4%AA%E5%BF%83/">贪心</a>
            
          </div>
        
      </div>
    </article>
  </div>



  <nav aria-label="navigation">
    <span class="pagination" id="pagination">
      <span class="page-number current">1</span><a class="page-number" href="/page/2/#board">2</a><a class="extend next" rel="next" href="/page/2/#board"><i class="iconfont icon-arrowright"></i></a>
    </span>
  </nav>



              </div>
            </div>
          </div>
        </div>
      </div>
    

    
      <a id="scroll-top-button" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v"
                 for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>
    

    
  </main>

  <footer class="text-center mt-5 py-3">
  <div class="footer-content">
     <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> 
  </div>
  

  

  
</footer>


  <!-- SCRIPTS -->
  
  <script  src="https://cdn.jsdelivr.net/npm/nprogress@0.2.0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/nprogress@0.2.0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js" ></script>
<script  src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.min.js" ></script>
<script  src="/js/debouncer.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>

<!-- Plugins -->


  
    <script  src="/js/img-lazyload.js" ></script>
  



  









  <script defer src="https://cdn.jsdelivr.net/npm/clipboard@2.0.6/dist/clipboard.min.js" ></script>






  <script  src="https://cdn.jsdelivr.net/npm/typed.js@2.0.11/lib/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var title = document.getElementById('subtitle').title;
      
      typing(title)
      
    })(window, document);
  </script>



  <script  src="/js/local-search.js" ></script>
  <script>
    (function () {
      var path = "/local-search.xml";
      $('#local-search-input').on('click', function() {
        searchFunc(path, 'local-search-input', 'local-search-result');
      });
      $('#modalSearch').on('shown.bs.modal', function() {
        $('#local-search-input').focus();
      });
    })()
  </script>















<!-- 主题的启动项 保持在最底部 -->
<script  src="/js/boot.js" ></script>


</body>
</html>
